package VN.EDU.IMIC.DEVELOPER.DOTHANHTUNG.EXAM1.BAI2;

public class Student implements IMICInterface {
	private int RollNo;
	private String Fullname;
	private int Sex;
	private String Email;
	private String Mobiles;
	private String Address;
	private double Mark;
	
	//constructor
	
	public Student(){
	}
	
	public Student(int RollNo, String Fullname, int Sex, String Email, String Mobiles, String Address, double Mark){
		this.RollNo = RollNo;
		this.Fullname = Fullname;
		this.Sex = Sex;
		this.Email = Email;
		this.Mobiles = Mobiles;
		this.Address = Address;
		this.Mark = Mark;
	}
	
	//properties
	
	public int getRollNo() {
		return RollNo;
	}

	public void setRollNo(int rollNo) {
		RollNo = rollNo;
	}

	public String getFullname() {
		return Fullname;
	}

	public void setFullname(String fullname) {
		Fullname = fullname;
	}

	public int getSex() {
		return Sex;
	}

	public void setSex(int sex) {
		Sex = sex;
	}

	public String getEmail() {
		return Email;
	}

	public void setEmail(String email) {
		Email = email;
	}

	public String getMobiles() {
		return Mobiles;
	}

	public void setMobiles(String mobiles) {
		Mobiles = mobiles;
	}

	public String getAddress() {
		return Address;
	}

	public void setAddress(String address) {
		Address = address;
	}

	public double getMark() {
		return Mark;
	}

	public void setMark(double mark) {
		Mark = mark;
	}
	
	@Override
	public String PrintStudentInfo(Object obj) {
		// TODO Auto-generated method stub
		String sex = "";
		if (((Student) obj).getSex() == 0){
			sex = "Nam";
		}
		if (((Student) obj).getSex() == 1){
			sex = "Nu";
		}
		return "Student "+((Student)obj).getRollNo() + " "+((Student)obj).getFullname()+" "
				+ sex + " " + ((Student)obj).getEmail() + " " + ((Student)obj).getAddress()
				+ " " + ((Student)obj).getMobiles()+ " " + ((Student)obj).getMark();
	}

	@Override
	public String CheckMarks(Object obj) {
		// TODO Auto-generated method stub
		String result = "";
		if (((Student)obj).getMark() >= 9.0){
			result = "Gioi";
		}
		if (((Student)obj).getMark() >= 7.5 && ((Student)obj).getMark() < 9){
			result = "Kha";
		}
		if (((Student)obj).getMark() >= 5 && ((Student)obj).getMark() <= 7){
			result = "Trung Binh";
		}
		if (((Student)obj).getMark() < 5){
			result = "Yeu";
		}
		
		return result;
	}

	@Override
	public boolean CompareTo(Object obj1, Object obj2) {
		// TODO Auto-generated method stub
		if (((Student)obj1).getMark() == ((Student)obj2).getMark()){
			return true;
		}
		return false;
	}

}
